<?php
$this->placeholder('page_title')->set('Permissions');

$roles = Zupal_Roles::getInstance();

$this->headScript()->captureStart();
$roles->render_script('role_list');
$this->headScript()->captureEnd();

$roles->render_store('role_store', ZUPAL_BASEURL . '/admin/acl/roledata');

$res = Zupal_Resources::getInstance();

$this->headScript()->captureStart();
$res->render_script('res_list');
$this->headScript()->captureEnd();

$res->render_store('res_store', ZUPAL_BASEURL . '/admin/acl/resdata');

?>
<table>
<tr>
	<td width="50%"><h2>Roles</h2></td>
	<td width="50%"><h2>Resources</h2></td>
</tr>
<tr>
<td>
<?
$roles->render_grid(
	$this,'role_list', 'role_store',
	 array(
			'id' => array('label' => 'ID', 'width' => 120),
			'label' => array('label' => 'Label', 'width' => 120),
			'view' => array('label' => '&nbsp;', 'width' => 30, 'get' => 'roles_view'),
			'edit' => array('label' => '&nbsp;', 'width' => 30, 'get' => 'roles_edit'),
			'delete' => array('label' => '&nbsp;', 'width' => 30, 'get' => 'roles_delete')
		),
		array('onRowClick' => 'role_row_click')
	);

?>
</td>
<td>
<?
$res->render_grid(
	$this,'res_list', 'res_store',
	 array(
			'id' => array('label' => 'ID', 'width' => 120),
			'label' => array('label' => 'Label', 'width' => 120),
			'view' => array('label' => '&nbsp;', 'width' => 30, 'get' => 'res_view'),
			'edit' => array('label' => '&nbsp;', 'width' => 30, 'get' => 'res_edit'),
			'delete' => array('label' => '&nbsp;', 'width' => 30, 'get' => 'res_delete')
		),
		array('onRowClick' => 'res_row_click')
	);

?>
</td>
</tr>
<tr>
	<th width="50%"><h2>New Role</h2></td>
	<td width="50%"><h2>New Resource</h2></td>
</tr>
<tr>
<td>
<?= new Zupal_Role_form() ?>
</td>
<td>
<?= new Zupal_Resource_Form() ?>
</td>
</tr>
</table>